/*
 * @Author: caofujun
 * @Date: 2020-08-20 20:54:36
 * @Description:
 */
import request from '@/utils/request'

export function login(up) {
  return request({
    url: 'admin/auth/login',
    method: 'post',
    data: {
      up: up
    }
  })
}

export function autoLogin(data) {
  return request({
    url: 'admin/auth/autoLogin',
    method: 'post',
    data
  })
}

// 测试埋点
export function test() {
  return request({
    url: 'md/Web',
    method: 'post',
    data: JSON.stringify({
      pageid: 'agency_top_up',
      actionid: 'into_agency_top_up',
      remark: {},
      platform: 3
    })
  })
}

export function testApi() {
  const par = { 'newsId': '23180', 'start': 0, 'offset': 5, 'FuncTag': 20006007, 'platform': 1, 'a': 1, 'l': 'en', 'c': 100101 }
  return request({
    url: 'admin',
    method: 'get',
    params: {
      parameter: JSON.stringify(par)
    }
  })
}

export function getInfo(aid) {
  return request({
    url: 'admin/auth/getAdminInfo',
    method: 'get',
    params: {
      aid: aid
    }
  })
}

export function getCodeImg() {
  return request({
    url: 'auth/code',
    method: 'get'
  })
}

// 获取供应链免登录的加密key
export function getAuthKey() {
  return request({
    url: 'admin/auth/keys',
    method: 'get'
  })
}
